import { request } from '@/http/axios';
import { IBase, IRecords } from '../app';

export interface IRole extends IBase {
  id?: number;
  roleName: string;
  status: number | string;
  remark: string;
  menuIds: string;
}

function upgrade(data) {
  return request({
    url: '/sys/role/upgrade',
    method: 'POST',
    data
  });
}

function records(data) {
  return request<IRecords<IRole>>({
    url: '/sys/role/records',
    data,
    method: 'POST'
  });
}

function del(id) {
  return request({
    url: '/sys/role/del',
    method: 'GET',
    params: { id }
  });
}

export const roleModel = {
  records,
  upgrade,
  del
};
